package ink.lovejinhu.swardToOffer;

import java.util.HashSet;

public class Offer_003 {
    /*
     *
     */
    public int findRepeatNumber(int[] nums) {
        HashSet<Integer> integers = new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            if (integers.contains(nums[i])) {
                return nums[i];
            } else {
                integers.add(nums[i]);
            }
        }
        return Integer.MAX_VALUE;
    }
}
